Page({
  data: {
    // 定义枚举
    fuText: {
      1: '受理中',
      2: '上门中',
      3: '已完成',
      0: '已取消',
    },
    fuClass: {
      1: 'info',
      2: 'success',
      3: 'complet',
      0: 'cancel'
    }
  },
  onShow() {
    //获取报修列表
    this.getRepairList()
  },
  async getRepairList() {
    const { data } = await wx.http.get('/repair', { current: 1, pageSize: 20 })
    // console.log(data);
    this.setData({
      repairList: data.rows
    })
  },
  goDetail(e) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + e.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
